Extracted relevant bits from Projac into this library