added function to determine magnitude, still need to implement