Added features from SebastianFM's PyramidION repo