Initial attempt

uses for loops and is not too clean, but achieves most tasks