Completed the port from the old CSS

Testing in progress.