added the code for swift point detection