error propagation added
imports and other things cleaned