added all functionality done so far together