all main functionality done