cleaned up code
Cleaned up code
removed comment about fixing typo
Removed logging statement from error handler
check if xs and ys exist