cleaned up

cleaned up warnings
added comments