functions merged and working

(: