converted grid to python because netbeans is being awkard
solved problem 12
solved problem 14