changed the variables
added a quick and dirty log function