time update, basic coding fixes and cosine similarity