Added code for floors + some refactoring