iteration one - very sloppy and needs work