function prettying and checking