Added master feature
Fixed many bugs