migrated recent changes
Changes made but still needs testing and fixes