cleaned up, fixed some errors