added more and cleaned up code