cleaned up code a bit, removed Time module