First attempt at programming assignment one