worked on the functions and tried permuations