Changed basic code skeleton to match the examples given, added comments