created a self executable function