gettin close
Code cleanup and testing