solves functions