Re-worked code a little bit...