fixed minor issue and speedup, started cv code for usability