added phpdocs to all functions