with stephen's help, loop is compiling, type is no longer forced, but not working quite right