modified buddy module for cross-platform