Commented code thoroughly