code cleaned up. comment added