Clock programming

is there a set of rules I need to follow?

Yes, and you clearly didn't. The first one was to read the sickies at the top of the forum BEFORE posting here. If you had, you'd have posted your code (correctly).