Cleaning up Logic

Remove certain redundant codes from Logic and solve bugs such as able to
edit time to a past time