working functions according to the specs