code cleaned from comments and old code