Added annotations and did some code cleansing