Merged bijish's code with myne.