fixes #21 : proper handling of formats. updates #1