start of class-based lomb scargle code