Added logging functionalality. Now throws exceptions with improper values