Edited breakpoints function

Rewriten and cleaned up the breakpoint function