functions for toy problems