Added date field, made some code better