cleaned up code for testin