Converted fucntions to var functions