done main functionality and modify tests