cleaned ccc function with maljub01 help