all main functionality is almost done