debugged refactored code. fixed date bug. removed obsolete code.