Input processing improved
Input tests added.