now slicing preserves the class of the model
Automatic style corrections courtesy of autopep8