Implement errors and overhaul for readability