everything's fixed
output isn't correct though