Removed some redundant code
Fixed time issue