small fix and gap fuction idea