Simplified and updated to version 0.2