Re-add changes from original preparegui