added all main functionality