Revamped the bonus function