added code for handling penthouse and refuge conditions