added error handling
fixed build errors
fixed extra spaces
refactoring Clock to its own package for encapsulation