diff --git a/docs/linecounter.sh b/docs/linecounter.sh
index 1a55af7832feedd08ffdaf15351aafe011bc0974..990cbae048a10b1d4d1e75e865c1fd3b1baadf53 100755
--- a/docs/linecounter.sh
+++ b/docs/linecounter.sh
@@ -4,7 +4,7 @@ if [ "$0" != "/tmp/lines/linecount.sh" ]; then
   mkdir -p /tmp/lines
   cp "$0" /tmp/lines/linecount.sh
   cd "$(dirname "$0")" || exit 1
-  cd ../src || exit 1
+  cd .. || exit 1
   exec /tmp/lines/linecount.sh
 fi
 
@@ -15,13 +15,13 @@ hash="$(git rev-parse HEAD)"
 for week in w6 w10 w13; do
   echo "week $week incoming..."
   git clean -fd
-  git checkout "w${week}"
+  git checkout "${week}"
 
   curr=$(wc -l $(find src -name "*.java") | grep total | awk '{print $1}')
   echo "$curr" > "/tmp/lines/$week"
   total=$(("$total" + "$curr"))
 
-  git reset --hard "w${week}"
+  git reset --hard "${week}"
 done
 
 echo "$total" > /tmp/lines/total