I think the answer to this question will give you a base to solve yours. Give it a shot:
also: Even those this is an older article it's got some good info: