Updated with Mike's changes