final functions - tested and passed