Updated with main functions but doesn't work