added the background wrapper function and merged some files