Cleaned up code and added -r flag to allow bp position to be relative to the reference database