Trimmed trailing spaces.
Moved week timestamp calculation to a separate function.
Added base code for comparing.