Copied from QuantDigger;
Remove useless codes (the pre-drawn idea);