testing out factor initialization when calculating GLLs
updated code to add some helper functions
removed some debug print statements