comments added, cleaned up a bit