Modified the code a bit so that it works by force