My attempt at some programming problems