Added floor detection